package com.wrl.mmall.common;

import com.google.common.collect.Sets;

import java.util.Set;

/**
 * 常量类
 *
 * @author Wang Renlei
 * @Date 2018/8/22 0010
 */
public class Const {
    //当前用户
    public static final String CURRENT_USER = "currentUser";
    //校验用的常量
    public static final String EMAIL = "email";
    public static final String USERNAME = "username";

    public static final String TOKEN_PREFIX = "token_";     //token前缀

    public interface RedisCacheExtime {
        int REDIS_SESSION_EXTIME = 60 * 30; //30分钟
    }

    //用户的权限
    public interface Role {
        int ROLE_CURRENT = 0;   //普通用户
        int ROLE_ADMIN = 1;     //管理员
    }

    //排序
    public interface productListOrderBy {
        Set<String> PRICE_ACS_DESC = Sets.newHashSet("price_desc", "price_asc");
    }

    //购物车选中状态
    public interface Cart {
        int CHECKED = 1;    //购物车选中状态
        int UN_CHECKED = 0; //购物车未选中状态

        String LIMIT_NUM_FAIL = "LIMIT_NUM_FAIL";
        String LIMIT_NUM_SUCCESS = "LIMIT_NUM_SUCCESS";
    }

    //
    public interface AlipayCallBack {
        //等待买家付款
        String TRADE_STATUS_WAIT_BUYER_PAY = "TRADE_STATUS_WAIT_BUYER_PAY";
        //
        String TRADE_STATUS_TRADE_SUCCESS = "TRADE_STATUS_TRADE_SUCCESS";

        String RESPONSE_SUCCESS = "success";
        String RESPONSE_FAILED = "failed";
    }

    //分布式锁
    public interface RedisLock {
        String CLOSE_ORDER_TASK_LOCK = "CLOSE_ORDER_TASK_LOCK";
    }


}
